@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@using netcoreTextMvc.Models;
@{
    ShowValue data = (ShowValue)ViewData["data"];
}
<a href="@Url.Action("InfoList","Money",new {id=@data.id })">列表</a>
<div>支出<span id="outvalue">@data.outValue</span></div><div>收入<span id="addvalue">@data.addValue</span></div><div>现在<span id="nowvalue">@data.nowValue</span></div>
<div id="container" style="height: 600px;width:100%"></div>
<form method="post">
    <div>
        <span>名字</span><input type="text" id="id" name="id" value="@data.id" />
        <span>图标类型</span><input type="text" id="chartType" name="chartType" value="@data.chartType" />
    </div>
    <div>
        <div>添加</div>
        <span>类型</span><input type="text" id="types" name="types" />
        <span>数额</span><input type="text" id="number" name="number" />
        <span>备注</span><input type="text" id="remarks" name="remarks" />
        <span>日期</span><input type="text" id="date" name="date" />
        <input type="submit" value="提交" />
    </div>
</form>
<script type="text/javascript">
    var dom = document.getElementById("container");
    var myChart = echarts.init(dom);
    var app = {};
    window.onload = function () {
        Setoption();
    }
    function Setoption() {
        var obj=@Html.Raw(data.strdata);
         var option;
    option = {
        xAxis: {
            type: 'category',
            data: obj.date,
        },
        yAxis: {
            type: 'value'
        },
        series: [{
            data:  obj.value,
            type: 'line'
        }]
    };
        //document.getElementById("outvalue").innerHTML = obj.outValue;
        //document.getElementById("addvalue").innerHTML = obj.addValue;
        //document.getElementById("nowvalue").innerHTML = obj.nowValue;
        if (option && typeof option === 'object') {
            myChart.setOption(option);
        }
    }
</script>
